PortNamespace: Fix bug in valid type checking of dynamic namespaces#255
Merged
sphuber merged 1 commit intosupport/0.21.xfrom Dec 7, 2022
Merged
PortNamespace: Fix bug in valid type checking of dynamic namespaces#255sphuber merged 1 commit intosupport/0.21.xfrom
PortNamespace: Fix bug in valid type checking of dynamic namespaces#255sphuber merged 1 commit intosupport/0.21.xfrom
Conversation
If a `valid_type` is set on a `PortNamespace` it is automatically made dynamic. If a namespace is dynamic, it means that it should accept any nested namespace, however deeply nested. However, the leafs of the inputs should still respect the `valid_type`. This was not the case though. As soon as a port namespace was made dynamic, any nested input namespace would be expected, regardless of the types of the leaf values. The `PortNamespace.validate_dynamic_ports` is made recursive. If a port value is a dictionary, it recursively calls itself to validate its nested values, ultimately making sure that leaf values have a valid type if one is specified for the namespace.
Codecov ReportBase: 90.73% // Head: 90.74% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## support/0.21.x #255 +/- ##
==================================================
+ Coverage 90.73% 90.74% +0.01%
==================================================
Files 21 21
Lines 2964 2967 +3
==================================================
+ Hits 2689 2692 +3
Misses 275 275
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
sphuber
added a commit
that referenced
this pull request
Dec 7, 2022
…#255) If a `valid_type` is set on a `PortNamespace` it is automatically made dynamic. If a namespace is dynamic, it means that it should accept any nested namespace, however deeply nested. However, the leafs of the inputs should still respect the `valid_type`. This was not the case though. As soon as a port namespace was made dynamic, any nested input namespace would be expected, regardless of the types of the leaf values. The `PortNamespace.validate_dynamic_ports` is made recursive. If a port value is a dictionary, it recursively calls itself to validate its nested values, ultimately making sure that leaf values have a valid type if one is specified for the namespace. Cherry-pick: 9fb5f1c
sphuber
added a commit
that referenced
this pull request
Dec 7, 2022
…#255) If a `valid_type` is set on a `PortNamespace` it is automatically made dynamic. If a namespace is dynamic, it means that it should accept any nested namespace, however deeply nested. However, the leafs of the inputs should still respect the `valid_type`. This was not the case though. As soon as a port namespace was made dynamic, any nested input namespace would be expected, regardless of the types of the leaf values. The `PortNamespace.validate_dynamic_ports` is made recursive. If a port value is a dictionary, it recursively calls itself to validate its nested values, ultimately making sure that leaf values have a valid type if one is specified for the namespace. Cherry-pick: 9fb5f1c
This was referenced Jan 11, 2023
unkcpz
pushed a commit
to unkcpz/plumpy
that referenced
this pull request
Dec 14, 2024
…aiidateam#255) If a `valid_type` is set on a `PortNamespace` it is automatically made dynamic. If a namespace is dynamic, it means that it should accept any nested namespace, however deeply nested. However, the leafs of the inputs should still respect the `valid_type`. This was not the case though. As soon as a port namespace was made dynamic, any nested input namespace would be expected, regardless of the types of the leaf values. The `PortNamespace.validate_dynamic_ports` is made recursive. If a port value is a dictionary, it recursively calls itself to validate its nested values, ultimately making sure that leaf values have a valid type if one is specified for the namespace. Cherry-pick: 9fb5f1c
agoscinski
pushed a commit
to agoscinski/plumpy
that referenced
this pull request
Apr 13, 2026
…aiidateam#255) If a `valid_type` is set on a `PortNamespace` it is automatically made dynamic. If a namespace is dynamic, it means that it should accept any nested namespace, however deeply nested. However, the leafs of the inputs should still respect the `valid_type`. This was not the case though. As soon as a port namespace was made dynamic, any nested input namespace would be expected, regardless of the types of the leaf values. The `PortNamespace.validate_dynamic_ports` is made recursive. If a port value is a dictionary, it recursively calls itself to validate its nested values, ultimately making sure that leaf values have a valid type if one is specified for the namespace. Cherry-pick: 9fb5f1c
agoscinski
pushed a commit
that referenced
this pull request
Apr 13, 2026
…#255) If a `valid_type` is set on a `PortNamespace` it is automatically made dynamic. If a namespace is dynamic, it means that it should accept any nested namespace, however deeply nested. However, the leafs of the inputs should still respect the `valid_type`. This was not the case though. As soon as a port namespace was made dynamic, any nested input namespace would be expected, regardless of the types of the leaf values. The `PortNamespace.validate_dynamic_ports` is made recursive. If a port value is a dictionary, it recursively calls itself to validate its nested values, ultimately making sure that leaf values have a valid type if one is specified for the namespace. Cherry-pick: 9fb5f1c
agoscinski
pushed a commit
that referenced
this pull request
Apr 13, 2026
…#255) If a `valid_type` is set on a `PortNamespace` it is automatically made dynamic. If a namespace is dynamic, it means that it should accept any nested namespace, however deeply nested. However, the leafs of the inputs should still respect the `valid_type`. This was not the case though. As soon as a port namespace was made dynamic, any nested input namespace would be expected, regardless of the types of the leaf values. The `PortNamespace.validate_dynamic_ports` is made recursive. If a port value is a dictionary, it recursively calls itself to validate its nested values, ultimately making sure that leaf values have a valid type if one is specified for the namespace. Cherry-pick: 9fb5f1c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If a
valid_typeis set on aPortNamespaceit is automatically made dynamic. If a namespace is dynamic, it means that it should accept any nested namespace, however deeply nested. However, the leafs of the inputs should still respect thevalid_type. This was not the case though. As soon as a port namespace was made dynamic, any nested input namespace would be expected, regardless of the types of the leaf values.The
PortNamespace.validate_dynamic_portsis made recursive. If a port value is a dictionary, it recursively calls itself to validate its nested values, ultimately making sure that leaf values have a valid type if one is specified for the namespace.